using System;
using System.Reflection;
using System.Text;

internal static class Class33
{
	public static bool CheckTypeIsModle(this Type type_0)
	{
		if (type_0 != TypeDefine.TypeString && type_0.IsClass && type_0 != TypeDefine.TypeByteArray)
		{
			if (type_0 != TypeDefine.TypeObject)
			{
				return true;
			}
		}
		return false;
	}

	public static void Assertion_Model(this Type type_0)
	{
		if (!type_0.CheckTypeIsModle())
		{
			throw new ArgumentException(string.Format("类型 {0} 不是有效的数据实体类型。", type_0.ToString()));
		}
	}

	public static bool smethod_2(this Type type_0)
	{
		return type_0.IsGenericType && type_0.GetGenericTypeDefinition() == TypeDefine.TypeNullable;
	}

	public static Type smethod_3(this Type type_0)
	{
		if (type_0.IsGenericType && type_0.GetGenericTypeDefinition() == TypeDefine.TypeNullable)
		{
			return type_0.GetGenericArguments()[0];
		}
		return type_0;
	}

	public static Type smethod_4(this Type type_0)
	{
		if (type_0.IsGenericType && type_0.GetGenericTypeDefinition() == TypeDefine.TypeNullable)
		{
			return type_0.GetGenericArguments()[0];
		}
		return null;
	}

	public static bool smethod_5(this Type type_0)
	{
		if (type_0 != TypeDefine.TypeString)
		{
			if (type_0 != TypeDefine.TypeByteArray)
			{
				return type_0.IsArray || TypeDefine.TypeIEnumerable.IsAssignableFrom(type_0);
			}
		}
		return false;
	}

	public static bool smethod_6(this Type type_0)
	{
		return type_0.GetConstructor(Type.EmptyTypes) != null;
	}

	public static string smethod_7(this Type type_0)
	{
		if (type_0.IsGenericType && !type_0.ContainsGenericParameters)
		{
			Type genericTypeDefinition = type_0.GetGenericTypeDefinition();
			string fullName = genericTypeDefinition.FullName;
			int length = fullName.IndexOf('`');
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(fullName.Substring(0, length)).Append("<");
			Type[] genericArguments = type_0.GetGenericArguments();
			Type[] array = genericArguments;
			for (int i = 0; i < array.Length; i++)
			{
				Type type_ = array[i];
				stringBuilder.Append(type_.smethod_7()).Append(",");
			}
			stringBuilder.Remove(stringBuilder.Length - 1, 1);
			stringBuilder.Append(">");
			return stringBuilder.ToString();
		}
		return type_0.FullName.Replace('+', '.');
	}

	public static bool smethod_8(this Type type_0)
	{
		return type_0.Name.StartsWith("<>f__AnonymousType");
	}

	public static bool smethod_9(this PropertyInfo propertyInfo_0)
	{
		if (propertyInfo_0 == null)
		{
			return false;
		}
		if (propertyInfo_0.CanRead)
		{
			MethodInfo getMethod = propertyInfo_0.GetGetMethod(true);
			return getMethod.GetParameters().Length > 0;
		}
		if (propertyInfo_0.CanWrite)
		{
			MethodInfo setMethod = propertyInfo_0.GetSetMethod(true);
			return setMethod.GetParameters().Length > 1;
		}
		return false;
	}
}
